/*
 *
 *
 * TControl.h
 */


#ifndef __TControl_H__
#define __TControl_H__


#include <Classes.hpp>


#pragma option push -b-
enum TAlign { alNone, alTop, alBottom, alLeft, alRight, alClient, alCustom };
#pragma option pop

#pragma option push -b-
enum QControls__9 { sfLeft, sfTop, sfWidth, sfHeight, sfFont };
#pragma option pop

typedef Set<QControls__9, sfLeft, sfFont>  TScalingFlags;


// namespace QControls {

class DELPHICLASS QWidget;
class DELPHICLASS TWidgetControl;

class PACKAGE TControl : public Classes::TComponent
{
    typedef Classes::TComponent inherited;
    
__published:
    __property int Top = {read = FTop, write = SetTop, nodefault};
    __property int Left = {read = FLeft, write = SetLeft, nodefault};
    __property int Height = {read = FHeight, write = SetHeight, nodefault};
    __property int Width = {read = FWidth, write = SetWidth, nodefault};
    
public:
    #pragma option push -w-inl
    /* TComponent.Create */ inline __fastcall TControl (Classes::TComponent * AOwner);
    #pragma option pop
    
    QWidget * FHandle;
    
    __property TAlign Align = {read = FAlign, write = SetAlign, default = 0};
    
    __property bool Enabled = {read = GetEnabled, write = SetEnabled, stored = IsEnabledStored, default = 1};
    
    __property TWidgetControl * Parent = {read = FParent, write = SetParent};
    
    __property bool Visible = {read = FVisible, write = SetVisible, stored = IsVisibleStored, default = 1};
    
    DYNAMIC TComponent * __fastcall GetParentComponent ();
    
    DYNAMIC bool __fastcall HasParent ();
    
    void __fastcall Show ();
    
    void __fastcall ShowAll ();
    
protected:
    int FTop;
    int FLeft;
    int FHeight;
    int FWidth;
    
    __property WideString Caption = {read = GetText, write = SetText};
    __property WideString Text = {read = GetText, write = SetText};
    
    __property Classes::TNotifyEvent OnClick = {read = FOnClick, write = FOnClick, stored = IsOnClickStored};
    
    DYNAMIC void __fastcall Click ();
    
    DYNAMIC void __fastcall EnabledChanged(void);
    
    DYNAMIC void __fastcall VisibleChanging(void);
    
    DYNAMIC void __fastcall VisibleChanged(void);
    
    virtual bool __fastcall GetEnabled(void);
    
    virtual WideString __fastcall GetText ();
    
    virtual void __fastcall SetEnabled(const bool Value);
    
    virtual void __fastcall SetName (const AnsiString Value);
    
    virtual void __fastcall SetParent (const TWidgetControl * Value);
    
    DYNAMIC void __fastcall SetParentComponent (TComponent * Value);
    
    virtual void __fastcall SetText (const WideString Value);
    
private:
    TAlign FAlign;
    bool FEnabled;
    TWidgetControl* FParent;
    TNotifyEvent FOnClick;
    bool FVisible;
    
    bool __fastcall IsEnabledStored ();
    
    bool __fastcall IsOnClickStored ();
    
    bool __fastcall IsVisibleStored ();
    
    void __fastcall SetAlign (const TAlign Value);
    
    void __fastcall SetTop (const int Value);
    
    void __fastcall SetLeft (const int Value);
    
    void __fastcall SetHeight (const int Value);
    
    void __fastcall SetWidth (const int Value);
    
    void __fastcall SetVisible (const bool Value);
};


// }; // QControls


// using namespace QControls;


#endif /* __TControl_H__ */
